package li.brauch.semesterarbeit.radio.views.util;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.Display;

public class FontStore {
	
	static {
		display = Display.getCurrent();
	}
	
	private static Display display;
	
	public static final Font TEXT = createFont(12,SWT.BOLD);
	public static final Font TITLE = createFont(18,SWT.BOLD);
	public static final Font TRACK_NAME = createFont(12, SWT.BOLD);
	public static final Font TRACK_ALBUM = createFont(12, SWT.NONE);
	
	public static void dispose() {
		TEXT.dispose();
		TITLE.dispose();
		TRACK_ALBUM.dispose();
		TRACK_NAME.dispose();
	}
	
	private static Font createFont(int height, int style) {
		
		FontData fontdata = new FontData();
		fontdata.setName("Dialog");
		fontdata.setHeight(height);
		fontdata.setStyle(style);
		return new Font(display, fontdata);
	}
}
